
package com.idealighter.game.games.happyfive.handler;

import com.idealighter.game.core.annotation.ResMsgHandler;
import com.idealighter.game.gamehall.dto.SeatInfo;
import com.idealighter.game.games.happyfive.message.ResReadyMsg;
import com.idealighter.game.message.core.ResMessage;
import com.idealighter.game.robot.core.Player;
import com.idealighter.game.robot.handler.ResMessageHandler;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


@ResMsgHandler(507204)
public class ResReadyHandler implements ResMessageHandler {

  private static final Logger LOG = LoggerFactory.getLogger(ResReadyHandler.class);

  @Override
  public void action(Player player, ResMessage message) {
    ResReadyMsg msg = (ResReadyMsg) message;
    SeatInfo seatInfo = player.seat(player.playerId);
    if (seatInfo != null && seatInfo.getOrder() == msg.getOrder()) {
      if (msg.getRes() == 0) {
        LOG.info("[欢乐五张]玩家[{}][{}]准备好", player.playerId, player.playerInfo.getNickName());
      }
    }
  }
}
